{% extends 'base.html' %}

{% block content %}
    <script>
        $('.book').removeClass('active')
        $('.index').removeClass('active')
        $('.author').addClass('active')
        $('.publish').removeClass('active')

    </script>
    <div class="panel panel-primary">
        <div class="panel-heading">作者列表</div>
        <div class="panel-body">
            <a href="/author_add/" class="btn btn-primary pull-right">新增</a>
            <table class="table table-striped">
                <thead>
                <tr>
                    <th>id</th>
                    <th>作者名</th>
                    <th>性别</th>
                </tr>
                </thead>
                <tbody>
                {% for author in author_list %}
                    <tr>
                        <td>{{ forloop.counter }}</td>
                        <td>{{ author.name }}</td>
                        <td>{{ author.sex }}</td>
                        <td><a href="/author_update/{{ author.pk }}">编辑</a></td>
                        <td><a href="/author_delete/?id={{ author.pk }}">删除</a></td>

                    </tr>

                {% endfor %}

                </tbody>
            </table>

        </div>
        <div class="panel-footer">
            <nav aria-label="Page navigation">
                <ul class="pagination">
                    <li>
                        <a href="#" aria-label="Previous">
                            <span aria-hidden="true">&laquo;</span>
                        </a>
                    </li>
                    <li><a href="#">1</a></li>
                    <li><a href="#">2</a></li>
                    <li><a href="#">3</a></li>
                    <li><a href="#">4</a></li>
                    <li><a href="#">5</a></li>
                    <li>
                        <a href="#" aria-label="Next">
                            <span aria-hidden="true">&raquo;</span>
                        </a>
                    </li>
                </ul>
            </nav>

        </div>
    </div>



{% endblock %}